<template>
  <div id="box">
    <el-card shadow="never">
      <el-table :data="tableData" style="width: 100%" border>
        <!-- <el-table-column type="selection" width="55" align="center" /> -->
        <el-table-column type="index" width="50" align="center">
          <template slot-scope="scope" align="center">
            {{ (pageNum - 1) * pageSize + scope.$index + 1 }}
          </template>
        </el-table-column>
        <el-table-column prop="name" label="统计名称" width="auto" align="center" />
        <el-table-column prop="graphType" label="统计类型" width="auto" align="center" />
        <el-table-column prop="created_at" label="创建时间" width="auto" align="center" />
        <el-table-column prop="username" label="创建人" width="150" align="center" />

        <!-- <el-table-column prop="sex" label="患者性别" align="center" /> -->
        <!-- <el-table-column fixed="right" label="操作" width="150" align="center">
            <template slot-scope="scope">
              <el-button size="mini" style="color: #1682e6;" class="mr-10" type="text" @click="go()">查看</el-button>
            </template>
          </el-table-column> -->
      </el-table>
      <el-pagination
        class="pagination"
        :current-page.sync="pageNum"
        :page-sizes="[10, 20]"
        :page-size.sync="pageSize"
        layout="sizes, prev, pager, next ,total"
        :total="total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />

    </el-card>
  </div>
  </el-card>
  </div>
</template>

<script>
import { selectList } from '@/api/back-management/statistical-set/statisticalSet'
export default {
  data() {
    return {
      pageSize: 10,
      pageNum: 1,
      total: 0,
      tableData: []
    }
  },
  computed: {},
  created() {
  },
  mounted() {
    this.queryList()
  },
  methods: {
    queryList() {
      const params = {
        apiToken: this.$store.getters.apiToken,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        type: '胸痛'
      }
      selectList(params).then(res => {
        this.tableData = res.data.list
        this.total = res.data.total
      })
    },

    handleSizeChange(val) {
      this.queryList()
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      this.queryList()
      console.log(`当前页: ${val}`)
    },
    resetForm(formName) {
      this.$refs[formName].resetFields()
    }

  }
}
</script>

<style>
</style>
